package com.tsystems.tuni.sportplanet.businesslogic;

import java.util.List;

import javax.ejb.Stateless;

import com.tsystems.tuni.sportplanet.businesslogic.accessinterfaces.SponsorStaticticBeanLocal;
import com.tsystems.tuni.sportplanet.businesslogic.accessinterfaces.SponsorStaticticBeanRemote;
import com.tsystems.tuni.sportplanet.dao.CompanyDAO;
import com.tsystems.tuni.sportplanet.dao.CompanyDAOImpl;
import com.tsystems.tuni.sportplanet.dao.LocationDAO;
import com.tsystems.tuni.sportplanet.dao.LocationDAOImpl;
import com.tsystems.tuni.sportplanet.dao.SeasonDAO;
import com.tsystems.tuni.sportplanet.dao.SeasonDAOImpl;
import com.tsystems.tuni.sportplanet.dao.SportDAO;
import com.tsystems.tuni.sportplanet.dao.SportDAOImpl;
import com.tsystems.tuni.sportplanet.dao.TeamDAO;
import com.tsystems.tuni.sportplanet.dao.TeamDAOImpl;
import com.tsystems.tuni.sportplanet.entity.Company;
import com.tsystems.tuni.sportplanet.entity.Location;
import com.tsystems.tuni.sportplanet.entity.Season;
import com.tsystems.tuni.sportplanet.entity.Sport;
import com.tsystems.tuni.sportplanet.entity.Team;

/**
 * @author Ippolitov Anton, Yuriy Eremin
 */
@Stateless
public class SponsorStatisticImpl implements SponsorStaticticBeanLocal,
		SponsorStaticticBeanRemote {

	private TeamDAO teamDAO = new TeamDAOImpl();
	private SportDAO sportDAO = new SportDAOImpl();
	private LocationDAO locationDAO = new LocationDAOImpl();
	private CompanyDAO companyDAO = new CompanyDAOImpl();
	private SeasonDAO seasonDAO = new SeasonDAOImpl();

	@Override
	public List<Team> getAllTeam() {
		return teamDAO.getAll(Team.class);
	}

	@Override
	public List<Sport> getAllSport() {
		return sportDAO.getAll(Sport.class);
	}

	@Override
	public List<Location> getAllLocationBySport(Sport sport) {
		return locationDAO.getAllLocationsBySport(sport);
	}

	@Override
	public List<Team> getTeamsFromCity(String city, Sport sport) {
		return teamDAO.getAllTeamsFromCity(city, sport);
	}

	@Override
	public int getLastTeamScore(Team team) {
		return teamDAO.getLastTeamScore(team);
	}

	@Override
	public List<Season> getPlayedSeason(Team team) {
		return seasonDAO.getPlayedSeason(team);
	}

	@Override
	public Company getCompanyByTeam(Team team) {
		return companyDAO.getCompanyByTeam(team);
	}

	@Override
	public Location getCompanyLocation(Company company) {
		return locationDAO.getCompanyLocation(company);
	}

	@Override
	public int getTeamScoreFromSeason(Team team, Season season) {
		return teamDAO.getTeamScoreFromSeason(team, season);
	}

	@Override
	public String getCompanyContact(String company) {
		return companyDAO.getCompanyContact(company);
	}

}
